﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using BLL.Access;
using System.Data;
using Platform.Http;
using Web.Class;
using Platform.Common;

namespace Web.Controls.LAIHAN
{
    public partial class UCLHJiHuanZYJHXX : System.Web.UI.UserControl
    {
        #region 属性

        public int M1
        {
            get
            {
                return
                    txtZYJH1.Text==""?0:Convert.ToInt32(txtZYJH1.Text);
            }
        }
        public int M2
        {
            get
            {
                return
                    txtZYJH2.Text == "" ? 0 : Convert.ToInt32(txtZYJH2.Text);
            }
        }
        public int M3
        {
            get
            {
                return
                    txtZYJH3.Text == "" ? 0 : Convert.ToInt32(txtZYJH3.Text);
            }
        }
        public int M4
        {
            get
            {
                return
                    txtZYJH4.Text == "" ? 0 : Convert.ToInt32(txtZYJH4.Text);
            }
        }
        public int M5
        {
            get
            {
                return
                   txtZYJH5.Text == "" ? 0 : Convert.ToInt32(txtZYJH5.Text);
            }
        }
        public int M6
        {
            get
            {
                return
                   txtZYJH6.Text == "" ? 0 : Convert.ToInt32(txtZYJH6.Text);
            }
        }
        public int M7
        {
            get
            {
                return
                    txtZYJH7.Text == "" ? 0 : Convert.ToInt32(txtZYJH7.Text);
            }
        }
        public int M8
        {
            get
            {
                return
                    txtZYJH8.Text == "" ? 0 : Convert.ToInt32(txtZYJH8.Text);
            }
        }
        public int M9
        {
            get
            {
                return
                   txtZYJH9.Text == "" ? 0 : Convert.ToInt32(txtZYJH9.Text);
            }
        }
        public int M10
        {
            get
            {
                return
                    txtZYJH10.Text == "" ? 0 : Convert.ToInt32(txtZYJH10.Text);
            }

        }
        public int M11
        {
            get
            {
                return
                   txtZYJH11.Text == "" ? 0 : Convert.ToInt32(txtZYJH11.Text);
            }
        }
        public int M12
        {
            get
            {
                return
                    txtZYJH12.Text == "" ? 0 : Convert.ToInt32(txtZYJH12.Text);
            }
        }
        /// <summary>
        /// 计划信息是否符合绑定完整
        /// </summary>
        public bool SumbitYN
        {
            get { return UCLHJiHuanZYJHXX_HIDLIST.Contains("JiaJiH") && UCLHJiHuanZYJHXX_HIDLIST.Contains("YiJiH") && UCLHJiHuanZYJHXX_HIDLIST.Get("JiaJiH").ToString().Length > 0 && UCLHJiHuanZYJHXX_HIDLIST.Get("YiJiH").ToString().Length > 0; }
           
        }

        #endregion

        #region 变量

        #endregion

        #region 事件

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
            }
        }

        #endregion

        #region 方法

        private void SetControlStatus(int y)
        {
            int waterYM = BusinessTool.GetWaterYM();
            int month = Convert.ToInt32(waterYM.ToString().Substring(4,2));
            int iy = Convert.ToInt32(waterYM.ToString().Substring(0, 4));
            if (iy == y)
            {
                switch (month )
                {
                    case 1:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH1.Text = "0";
                        break;
                    case 2: 
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        break;
                    case 3:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        break;
                    case 4:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        break;
                    case 5:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        
                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        break;
                    case 6:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        txtZYJH6.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        txtZYJH6.Text = "0";
                        break;
                    case 7:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        txtZYJH6.ReadOnly = true;
                        txtZYJH7.ReadOnly = true;
                         
                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        txtZYJH6.Text = "0";
                        txtZYJH7.Text = "0";
                        break;
                    case 8:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        txtZYJH6.ReadOnly = true;
                        txtZYJH7.ReadOnly = true;
                        txtZYJH8.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        txtZYJH6.Text = "0";
                        txtZYJH7.Text = "0";
                        txtZYJH8.Text = "0";
                        break;
                    case 9:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        txtZYJH6.ReadOnly = true;
                        txtZYJH7.ReadOnly = true;
                        txtZYJH8.ReadOnly = true;
                        txtZYJH9.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        txtZYJH6.Text = "0";
                        txtZYJH7.Text = "0";
                        txtZYJH8.Text = "0";
                        txtZYJH9.Text = "0";
                        break;
                    case 10:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        txtZYJH6.ReadOnly = true;
                        txtZYJH7.ReadOnly = true;
                        txtZYJH8.ReadOnly = true;

                        txtZYJH9.ReadOnly = true;
                        txtZYJH10.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        txtZYJH6.Text = "0";
                        txtZYJH7.Text = "0";
                        txtZYJH8.Text = "0";
                        txtZYJH9.Text = "0";
                        txtZYJH10.Text = "0";
                        break;
                    case 11:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        txtZYJH6.ReadOnly = true;
                        txtZYJH7.ReadOnly = true;
                        txtZYJH8.ReadOnly = true;
                        txtZYJH9.ReadOnly = true;
                        txtZYJH10.ReadOnly = true;
                        txtZYJH11.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        txtZYJH6.Text = "0";
                        txtZYJH7.Text = "0";
                        txtZYJH8.Text = "0";
                        txtZYJH9.Text = "0";
                        txtZYJH10.Text = "0";
                        txtZYJH11.Text = "0";
                        break;
                    case 12:
                        txtZYJH1.ReadOnly = true;
                        txtZYJH2.ReadOnly = true;
                        txtZYJH3.ReadOnly = true;
                        txtZYJH4.ReadOnly = true;
                        txtZYJH5.ReadOnly = true;
                        txtZYJH6.ReadOnly = true;
                        txtZYJH7.ReadOnly = true;
                        txtZYJH8.ReadOnly = true;
                        txtZYJH9.ReadOnly = true;
                        txtZYJH10.ReadOnly = true;
                        txtZYJH11.ReadOnly = true;
                        txtZYJH12.ReadOnly = true;

                        txtZYJH1.Text = "0";
                        txtZYJH2.Text = "0";
                        txtZYJH3.Text = "0";
                        txtZYJH4.Text = "0";
                        txtZYJH5.Text = "0";
                        txtZYJH6.Text = "0";
                        txtZYJH7.Text = "0";
                        txtZYJH8.Text = "0";
                        txtZYJH9.Text = "0";
                        txtZYJH10.Text = "0";
                        txtZYJH11.Text = "0";
                        txtZYJH12.Text = "0";
                        break;
                }
            }
        }

        /// <summary>
        /// 绑定计划文本框
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="type">1甲 2 乙 3</param>
        public void BindJHXX(DataSet ds,int type)
        {
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                
                DataRow dr = ds.Tables[0].Rows[0];
                int y = Convert.ToInt32(dr["I_Y"]);

                SetControlStatus(y);
                if (type == 1)
                {
                    UCLHJiHuanZYJHXX_HIDLIST.Set("JiaJiH", dr["ID"]);
                    txtJiaYuanJH1.Text = dr["I_M1"].ToString();
                    txtJiaYuanJH2.Text = dr["I_M2"].ToString();
                    txtJiaYuanJH3.Text = dr["I_M3"].ToString();
                    txtJiaYuanJH4.Text = dr["I_M4"].ToString();
                    txtJiaYuanJH5.Text = dr["I_M5"].ToString();

                    txtJiaYuanJH6.Text = dr["I_M6"].ToString();
                    txtJiaYuanJH7.Text = dr["I_M7"].ToString();
                    txtJiaYuanJH8.Text = dr["I_M8"].ToString();
                    txtJiaYuanJH9.Text = dr["I_M9"].ToString();
                    txtJiaYuanJH10.Text = dr["I_M10"].ToString();

                    txtJiaYuanJH11.Text = dr["I_M11"].ToString();
                    txtJiaYuanJH12.Text = dr["I_M12"].ToString();
                    txtJiaYuanJH13.Text = (Convert.ToInt32(dr["I_M1"]) + Convert.ToInt32(dr["I_M2"]) + Convert.ToInt32(dr["I_M3"]) + Convert.ToInt32(dr["I_M4"]) + Convert.ToInt32(dr["I_M5"]) + Convert.ToInt32(dr["I_M6"]) + Convert.ToInt32(dr["I_M7"]) + Convert.ToInt32(dr["I_M8"]) + Convert.ToInt32(dr["I_M9"]) + Convert.ToInt32(dr["I_M10"]) + Convert.ToInt32(dr["I_M11"]) + Convert.ToInt32(dr["I_M12"])).ToString();
                }
                else if(type==2)
                {
                    UCLHJiHuanZYJHXX_HIDLIST.Set("YiJiH", dr["ID"]);
                    txtYiYuanJH1.Text = dr["I_M1"].ToString();
                    txtYiYuanJH2.Text = dr["I_M2"].ToString();
                    txtYiYuanJH3.Text = dr["I_M3"].ToString();
                    txtYiYuanJH4.Text = dr["I_M4"].ToString();
                    txtYiYuanJH5.Text = dr["I_M5"].ToString();

                    txtYiYuanJH6.Text = dr["I_M6"].ToString();
                    txtYiYuanJH7.Text = dr["I_M7"].ToString();
                    txtYiYuanJH8.Text = dr["I_M8"].ToString();
                    txtYiYuanJH9.Text = dr["I_M9"].ToString();
                    txtYiYuanJH10.Text = dr["I_M10"].ToString();

                    txtYiYuanJH11.Text = dr["I_M11"].ToString();
                    txtYiYuanJH12.Text = dr["I_M12"].ToString();
                    txtYiYuanJH13.Text = (Convert.ToInt32(dr["I_M1"]) + Convert.ToInt32(dr["I_M2"]) + Convert.ToInt32(dr["I_M3"]) + Convert.ToInt32(dr["I_M4"]) + Convert.ToInt32(dr["I_M5"]) + Convert.ToInt32(dr["I_M6"]) + Convert.ToInt32(dr["I_M7"]) + Convert.ToInt32(dr["I_M8"]) + Convert.ToInt32(dr["I_M9"]) + Convert.ToInt32(dr["I_M10"]) + Convert.ToInt32(dr["I_M11"]) + Convert.ToInt32(dr["I_M12"])).ToString();
                }
            }
            //Dictionary<string, string> d = UCLHJiHuanZYJHXX_HIDLIST as Dictionary<string, string>;
            if (UCLHJiHuanZYJHXX_HIDLIST.Contains("JiaJiH") && UCLHJiHuanZYJHXX_HIDLIST.Contains("YiJiH"))
            {
                if (UCLHJiHuanZYJHXX_HIDLIST.Get("JiaJiH").ToString().Length > 0 && UCLHJiHuanZYJHXX_HIDLIST.Get("YiJiH").ToString().Length > 0)
                {
                   
                }
            }
           
        }
        /// <summary>
        /// 验证输入值是否正确
        /// </summary>
        /// <returns></returns>
        public bool CheckInsertValue()
        {
            bool b = false;
            int txtvalue = 0;
            int count = 0;
            if (!int.TryParse(txtZYJH1.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH2.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH3.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH4.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH5.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH6.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH7.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH8.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH9.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH10.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH11.Text, out txtvalue))
            {
                count += 1;
            }
            if (!int.TryParse(txtZYJH12.Text, out txtvalue))
            {
                count += 1;
            }
            if (count == 0)
            {
                b = true;
            }
            return b;
        }

        /// <summary>
        /// 绑定转移计划信息
        /// </summary>
        /// <param name="dt"></param>
        public void BindJHL(DataTable dt)
        {
            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                txtZYJH1.Text = dt.Rows[0]["I_M1"].ToString();
                txtZYJH2.Text = dt.Rows[0]["I_M2"].ToString();
                txtZYJH3.Text = dt.Rows[0]["I_M3"].ToString();
                txtZYJH4.Text = dt.Rows[0]["I_M4"].ToString();
                txtZYJH5.Text = dt.Rows[0]["I_M5"].ToString();

                txtZYJH6.Text = dt.Rows[0]["I_M6"].ToString();
                txtZYJH7.Text = dt.Rows[0]["I_M7"].ToString();
                txtZYJH8.Text = dt.Rows[0]["I_M8"].ToString();
                txtZYJH9.Text = dt.Rows[0]["I_M9"].ToString();
                txtZYJH10.Text = dt.Rows[0]["I_M10"].ToString();

                txtZYJH11.Text = dt.Rows[0]["I_M11"].ToString();
                txtZYJH12.Text = dt.Rows[0]["I_M12"].ToString();
                txtZYJH13.Text = (Convert.ToInt32(dr["I_M1"]) + Convert.ToInt32(dr["I_M2"]) + Convert.ToInt32(dr["I_M3"]) + Convert.ToInt32(dr["I_M4"]) + Convert.ToInt32(dr["I_M5"]) + Convert.ToInt32(dr["I_M6"]) + Convert.ToInt32(dr["I_M7"]) + Convert.ToInt32(dr["I_M8"]) + Convert.ToInt32(dr["I_M9"]) + Convert.ToInt32(dr["I_M10"]) + Convert.ToInt32(dr["I_M11"]) + Convert.ToInt32(dr["I_M12"])).ToString();


                txtYiXianJH1.Text = (Convert.ToInt32(txtYiYuanJH1.Text) + Convert.ToInt32(txtZYJH1.Text)).ToString();
                txtYiXianJH2.Text = (Convert.ToInt32(txtYiYuanJH2.Text) + Convert.ToInt32(txtZYJH2.Text)).ToString();
                txtYiXianJH3.Text = (Convert.ToInt32(txtYiYuanJH3.Text) + Convert.ToInt32(txtZYJH3.Text)).ToString();
                txtYiXianJH4.Text = (Convert.ToInt32(txtYiYuanJH4.Text) + Convert.ToInt32(txtZYJH4.Text)).ToString();
                txtYiXianJH5.Text = (Convert.ToInt32(txtYiYuanJH5.Text) + Convert.ToInt32(txtZYJH5.Text)).ToString();

                txtYiXianJH6.Text = (Convert.ToInt32(txtYiYuanJH6.Text) + Convert.ToInt32(txtZYJH6.Text)).ToString();
                txtYiXianJH7.Text = (Convert.ToInt32(txtYiYuanJH7.Text) + Convert.ToInt32(txtZYJH7.Text)).ToString();
                txtYiXianJH8.Text = (Convert.ToInt32(txtYiYuanJH8.Text) + Convert.ToInt32(txtZYJH8.Text)).ToString();
                txtYiXianJH9.Text = (Convert.ToInt32(txtYiYuanJH9.Text) + Convert.ToInt32(txtZYJH9.Text)).ToString();
                txtYiXianJH10.Text = (Convert.ToInt32(txtYiYuanJH10.Text) + Convert.ToInt32(txtZYJH10.Text)).ToString();

                txtYiXianJH11.Text = (Convert.ToInt32(txtYiYuanJH11.Text) + Convert.ToInt32(txtZYJH11.Text)).ToString();
                txtYiXianJH12.Text = (Convert.ToInt32(txtYiYuanJH12.Text) + Convert.ToInt32(txtZYJH12.Text)).ToString();
                txtYiXianJH13.Text = (Convert.ToInt32(txtYiYuanJH13.Text) + Convert.ToInt32(txtZYJH13.Text)).ToString();


                txtJiaXianJH1.Text = (Convert.ToInt32(txtJiaYuanJH1.Text) - Convert.ToInt32(txtZYJH1.Text)).ToString();
                txtJiaXianJH2.Text = (Convert.ToInt32(txtJiaYuanJH2.Text) - Convert.ToInt32(txtZYJH2.Text)).ToString();
                txtJiaXianJH3.Text = (Convert.ToInt32(txtJiaYuanJH3.Text) - Convert.ToInt32(txtZYJH3.Text)).ToString();
                txtJiaXianJH4.Text = (Convert.ToInt32(txtJiaYuanJH4.Text) - Convert.ToInt32(txtZYJH4.Text)).ToString();
                txtJiaXianJH5.Text = (Convert.ToInt32(txtJiaYuanJH5.Text) - Convert.ToInt32(txtZYJH5.Text)).ToString();

                txtJiaXianJH6.Text = (Convert.ToInt32(txtJiaYuanJH6.Text) - Convert.ToInt32(txtZYJH6.Text)).ToString();
                txtJiaXianJH7.Text = (Convert.ToInt32(txtJiaYuanJH7.Text) - Convert.ToInt32(txtZYJH7.Text)).ToString();
                txtJiaXianJH8.Text = (Convert.ToInt32(txtJiaYuanJH8.Text) - Convert.ToInt32(txtZYJH8.Text)).ToString();
                txtJiaXianJH9.Text = (Convert.ToInt32(txtJiaYuanJH9.Text) - Convert.ToInt32(txtZYJH9.Text)).ToString();
                txtJiaXianJH10.Text = (Convert.ToInt32(txtJiaYuanJH10.Text) - Convert.ToInt32(txtZYJH10.Text)).ToString();

                txtJiaXianJH11.Text = (Convert.ToInt32(txtJiaYuanJH11.Text) - Convert.ToInt32(txtZYJH11.Text)).ToString();
                txtJiaXianJH12.Text = (Convert.ToInt32(txtJiaYuanJH12.Text) - Convert.ToInt32(txtZYJH12.Text)).ToString();
                txtJiaXianJH13.Text = (Convert.ToInt32(txtJiaYuanJH13.Text) - Convert.ToInt32(txtZYJH13.Text)).ToString();
               
            }
        }
        /// <summary>
        /// 清空计划信息文本框
        /// </summary>
        public void ClearJHXX( int type)
        {
            if (type == 1)
            {
                txtJiaYuanJH1.Text = "0";
                txtJiaYuanJH2.Text = "0";
                txtJiaYuanJH3.Text = "0";
                txtJiaYuanJH4.Text = "0";
                txtJiaYuanJH5.Text = "0";

                txtJiaYuanJH6.Text = "0";
                txtJiaYuanJH7.Text = "0";
                txtJiaYuanJH8.Text = "0";
                txtJiaYuanJH9.Text = "0";
                txtJiaYuanJH10.Text = "0";

                txtJiaYuanJH11.Text = "0";
                txtJiaYuanJH12.Text = "0";
                txtJiaYuanJH13.Text = "0";
            }
            else if (type == 2)
            {
                txtYiYuanJH1.Text = "0";
                txtYiYuanJH2.Text = "0";
                txtYiYuanJH3.Text = "0";
                txtYiYuanJH4.Text = "0";
                txtYiYuanJH5.Text = "0";

                txtYiYuanJH6.Text = "0";
                txtYiYuanJH7.Text = "0";
                txtYiYuanJH8.Text = "0";
                txtYiYuanJH9.Text = "0";
                txtYiYuanJH10.Text = "0";

                txtYiYuanJH11.Text = "0";
                txtYiYuanJH12.Text = "0";
                txtYiYuanJH13.Text = "0";
            }
        }
        /// <summary>
        /// 设置输入框状态
        /// </summary>
        public void SetShouLiStatus()
        {
            txtZYJH1.ReadOnly = true;
            txtZYJH2.ReadOnly = true;
            txtZYJH3.ReadOnly = true;
            txtZYJH4.ReadOnly = true;
            txtZYJH5.ReadOnly = true;

            txtZYJH6.ReadOnly = true;
            txtZYJH7.ReadOnly = true;
            txtZYJH8.ReadOnly = true;
            txtZYJH9.ReadOnly = true;
            txtZYJH10.ReadOnly = true;

            txtZYJH11.ReadOnly = true;
            txtZYJH12.ReadOnly = true;
        }

        public void SetFocusControl()
        {
            if (!txtZYJH1.ReadOnly)
            {
                txtZYJH1.Focus();
            }
            else if (!txtZYJH2.ReadOnly)
            {
                txtZYJH2.Focus();
            }
            else if (!txtZYJH3.ReadOnly)
            {
                txtZYJH3.Focus();
            }
            else if (!txtZYJH4.ReadOnly)
            {
                txtZYJH4.Focus();
            }
            else if (!txtZYJH5.ReadOnly)
            {
                txtZYJH5.Focus();
            }
            else if (!txtZYJH6.ReadOnly)
            {
                txtZYJH6.Focus();
            }
            else if (!txtZYJH7.ReadOnly)
            {
                txtZYJH7.Focus();
            }
            else if (!txtZYJH8.ReadOnly)
            {
                txtZYJH8.Focus();
            }
            else if (!txtZYJH9.ReadOnly)
            {
                txtZYJH9.Focus();
            }
            else if (!txtZYJH10.ReadOnly)
            {
                txtZYJH10.Focus();
            }
            else if (!txtZYJH11.ReadOnly)
            {
                txtZYJH11.Focus();
            }
            else if (!txtZYJH12.ReadOnly)
            {
                txtZYJH12.Focus();
            }
        }
        #endregion
    }
}